package com.ybbase.framework.model.po.system;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 系统附件
 * </p>
 *
 * @author cg
 * @since 2019-11-26
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("sys_annex")
@ApiModel(value="Annex对象", description="系统附件")
public class Annex extends Model<Annex> {

    private static final long serialVersionUID=1L;

    @ApiModelProperty(value = "唯一编码")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "附件名称")
    private String name;

    @ApiModelProperty(value = "附件类型 : 0图片 1视频 2 文件")
    private String type;

    @ApiModelProperty(value = "路径 : 文件存储路径")
    private String path;

    @ApiModelProperty(value = "表中的唯一编码")
    private Integer tableId;

    @ApiModelProperty(value = "上传的表名")
    private String tableName;

    @ApiModelProperty(value = "创建人")
    @TableField(fill = FieldFill.INSERT)
    private Integer createBy;

    @ApiModelProperty(value = "创建时间 : 创建时间")
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createDate;

    @ApiModelProperty(value = "更新人 : 更新人")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Integer updateBy;

    @ApiModelProperty(value = "更新人 : 更新人")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;

    @ApiModelProperty(value = "备注")
    private String remarks;

    @ApiModelProperty(value = "乐观锁版本管理")
    private Integer version;

    @ApiModelProperty(value = "部门ID")
    @TableField(fill = FieldFill.INSERT)
    private Integer organId;

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    @ApiModelProperty(value = "创建人")
    @TableField(exist = false)
    private String userName;
}
